/*
 *
berg	冰山
cliff	悬崖
gorge	峡谷
plot	小块地, 地点
precipice	悬崖
tract	一片区域
tract	地带
请输入要查找的英文单词: plot
小块地, 地点
请输入要查找的中文单词: 悬崖
cliff
precipice

 */
#include <iostream>
#include <map>
using namespace std;
int main(void){

	multimap<string, string> dict;
	multimap<string, string>::iterator p;
	string eng[]={"plot", "gorge", "cliff", "berg", "precipice", "tract"};
	string che[]={"小块地, 地点", "峡谷", "悬崖", "冰山", "悬崖", "一片区域"};
	for(int i=0; i<6; i++){
		dict.insert(make_pair(eng[i], che[i]));  //批量插入
	}
	
	//插入单个元素
	dict.insert(make_pair(string("tract"),string("地带")));
	for(p=dict.begin(); p!=dict.end(); p++)
		cout << p->first << "\t" << p->second << endl;
	
	string word;
	cout << "请输入要查找的英文单词: ";
	cin >> word;
	for(p=dict.begin(); p!=dict.end(); p++){
		if(p->first == word){
			cout <<p->second << endl;
		}
	}
	
	cout<< "请输入要查找的中文单词: ";
	cin >> word;
	for(p=dict.begin(); p!=dict.end(); p++){
		if(p->second == word){
			cout <<p->first << endl;
		}
	}
	return 0;
}
